package com.neuedu.his.controller;


import com.neuedu.his.entity.FmedItem;
import com.neuedu.his.service.FmedItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/FmedItem")
public class FmedItemController {

    @Autowired
    FmedItemService FmeService;

    @RequestMapping("/selectAll")
    // http://localhost:8088/FmedItem/selectAll
    public List<FmedItem> selectAll(FmedItem fme){
        return FmeService.selectAll(fme);
    }

    @RequestMapping("/selectByName")
    // http://localhost:8088/FmedItem/selectByName?itemname=计算机
    public List<FmedItem> selectByName(FmedItem fme){
        return FmeService.selectByName(fme);
    }

    @RequestMapping("/update")
    // http://localhost:8088/FmedItem/update?
    public int update(FmedItem fme){
        return FmeService.update(fme);
    }

    @RequestMapping("/add")
    // http://localhost:8088/FmedItem/add?
    public int add(FmedItem fme){
        return FmeService.add(fme);
    }

    @RequestMapping("/delete")
    // http://localhost:8088/FmedItem/delete?id=57
    public int delete(FmedItem fme) {
        return FmeService.delete(fme);
    }
}
